package com.geostar.constructionland.attachment.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.geostar.constructionland.attachment.entity.GeoAttachment;
import com.geostar.constructionland.attachment.mapper.GeoAttachmentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author : yell
 * @Description: 附件服务
 * @date : 2020/12/29 17:14
 */
@Service
public class AttachmentService {
    @Autowired
    GeoAttachmentMapper geoAttachmentMapper;
    /***文件MD5**/
    public boolean isExist(String md5){
        boolean isExist = false;
        QueryWrapper<GeoAttachment> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("md5Code",md5);
        List<GeoAttachment> list = geoAttachmentMapper.selectList(queryWrapper);
        if(list.size() > 0){
            isExist = true;
        }
        return isExist;
    }
}
